package com.rzcode.coinex.kernel.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 系统角色
 *
 * @author Bridge.Xu
 * @date 2020年12月18日
 */

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "admin_role")
public class SysRole {

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 角色名
     */
    @ApiModelProperty(value = "角色名")
    private String role;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述")
    private String description;

    @JsonIgnore
    private List<SysPermission> permissions;

    public SysRole(Long id, String role) {
        this.id = id;
        this.role = role;
    }

    public SysRole(Long id, String role,String description) {
        this.id = id;
        this.role = role;
        this.description = description ;
    }


}
